# 字符串的定义
str = 'name'
str_1 = "i name is 'zhangsan'"

# 输出长度
print(len(str_1))
print(str_1[3])

# 统计某个字符串出现的次数
print(str_1.count('i'))
print(str_1.count('is'))

# 输出字符串的下标
print(str_1.index('i'))
print(str_1.index('is'))

# 循环输出
# for x in str_1 :
#     print(x)

# 输出字符串的所有方法
print(dir(str_1))

